/**
 * Author : wang885298.
 * Date   : 2018/6/21.
 * File   : pat.
 */

import {get, post} from '../post/post-proxy'

/**
 * 获取随手拍列表
 * @param page
 * @param limit
 * @param isCheck
 * @param type
 * @returns {Promise}
 */
exports.getSnapShotList = ({page, limit, isCheck, type}) => {
  let params = {
    'page': page,
    'limit': limit,
    'isCheck': 1,
    'type': type
  }
  return get('/api/getSnapShotList', params)
}

/**
 * 发布随手拍接口
 * @returns {Promise}
 */
exports.addSnapShot = (params) => {
  return post('/api/addSnapShot', params)
}

/**
 * 添加随手拍评论接口
 * @param snapShotId
 * @param userName
 * @param content
 * @returns {Promise}
 */
exports.addSnapShotReply = ({snapShotId, userName, content}) => {
  let params = {
    'snapShotId': snapShotId,
    'userName': userName,
    'content': content
  }
  return post('/api/addSnapShotReply', params)
}

/**
 *获取随手拍评论列表
 * @param snapShotId
 * @returns {Promise}
 */
exports.getSnapShotReplyList = ({snapShotId}) => {
  let params = {
    'snapShotId': snapShotId
  }
  return get('/api/getSnapShotReplyList/' + snapShotId, params)
}
